package com.java.category.controller;

import com.java.category.service.CategoryService;
import com.java.param.PageParam;
import com.java.pojo.Category;
import com.java.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/category")
public class CategoryAdminController {
    @Autowired
    private CategoryService categoryService;

    @PostMapping("/admin/list")
    public R list(@RequestBody PageParam pageParam){
        return categoryService.list(pageParam);
    }

    @PostMapping("/admin/save")
    public R save(@RequestBody Category category){
        return categoryService.save(category);
    }

    @PostMapping("/admin/remove")
    public R remove(@RequestBody Category category){
        return categoryService.remove(category);
    }
    @PostMapping("/admin/update")
    public R update(@RequestBody Category category){
        return categoryService.update(category);
    }


}
